from django.contrib.auth.models import AbstractUser
from django.db import models

from utils.utils import validate_mobile, validate_amount


# Create your models here.
class User(AbstractUser):
    mobile = models.CharField(max_length=11, null=True, validators=[validate_mobile], db_comment="手机号")
    nickName = models.CharField(max_length=50, blank=True, null=True, db_comment="昵称")
    gender = models.SmallIntegerField( blank=True, null=True, default=0, db_comment='性别')
    language = models.CharField('语言', max_length=20, blank=True, null=True, db_comment="语言")
    city = models.CharField('城市', max_length=20, blank=True, null=True, db_comment="城市")
    province = models.CharField('省份', max_length=50, blank=True, null=True, db_comment="省份")
    country = models.CharField('国家', max_length=50, blank=True, null=True, db_comment="国家")
    avatarUrl = models.URLField('头像', blank=True, null=True, db_comment="头像")

